import {isFirefox} from './tools';

export type ImageViewerAction = 'zoomIn' | 'zoomOut' | 'clocelise' | 'anticlocelise';

export const mousewheelEventName = isFirefox() ? 'DOMMouseScroll' : 'mousewheel';

export const INIT_TRANSFORM = {
  scale: 1,
  deg: 0,
  offsetX: 0,
  offsetY: 0,
  enableTransition: false,
}

// 键盘按键值
export const EVENT_CODE = {
  space: "Space",
  left: "ArrowLeft", // 37
  up: "ArrowUp", // 38
  right: "ArrowRight", // 39
  down: "ArrowDown", // 40
  esc: "Escape",
};

// icon对应的svg
export const ICON_SVG = {
  close: `<svg t="1628759850204" viewBox="0 0 1024 1024" width="24" height="24"><path d="M764 215.008L512 467.008 260 215.008q-10.016-8.992-22.496-8.992t-22.016 9.504-9.504 22.016 8.992 22.496l252 252-252 252q-12.992 12.992-8.512 31.008t22.016 22.496 31.488-8.512l252-252 252 252q10.016 8.992 22.496 8.992t22.016-9.504 9.504-22.016-8.992-22.496L556.992 512l252-252q12.992-12.992 8.512-31.008t-22.496-22.496-31.008 8.512z" p-id="3923" fill="#ffffff"></path></svg>`,
  arrowLeft: '<svg t="1628762138411" viewBox="0 0 1024 1024" width="24" height="24"><path d="M608.992 148.992L277.984 489.984q-8.992 8.992-8.992 21.504t8.992 22.496l331.008 340.992q8.992 8 20.992 8t20.992-8.992 8.992-20.992-8.992-20.992l-312-320 312-320q8.992-8.992 8.992-20.992t-8.992-20.992-20.992-8.992-20.992 8z" p-id="5372" fill="#ffffff"></path></svg>',
  arrowRight: '<svg t="1628762150860" viewBox="0 0 1024 1024" width="24" height="24"><path d="M340.992 148.992q-8.992 10.016-8.992 22.016t8.992 20.992l312 320-312 320q-8.992 8.992-8.992 20.992t8.992 20.992 20.992 8.992 20.992-8l331.008-340.992q8.992-8.992 8.992-22.016t-8.992-22.016L382.976 148.96q-8.992-8-20.992-8t-20.992 8z" p-id="5663" fill="#ffffff"></path></svg>',
  zoomOut: '<svg t="1628761969296" viewBox="0 0 1024 1024" width="24" height="24"><path d="M796 751.008l124.992 124.992q8.992 10.016 8.992 22.496t-9.504 22.016-22.016 9.504-22.496-8.992l-124.992-124.992q-132.992 108.992-295.008 99.488t-280.992-132.512q-114.016-128.992-111.008-291.008t122.016-286.016q124-119.008 286.016-122.016t291.008 111.008q123.008 119.008 132.512 280.992t-99.488 295.008zM480 832q150.016-4 248.992-103.008T832 480q-4-150.016-103.008-248.992T480 128q-150.016 4-248.992 103.008T128 480q4 150.016 103.008 248.992T480 832z m-128-384h256q14.016 0 23.008 8.992T640 480t-8.992 23.008T608 512h-256q-14.016 0-23.008-8.992T320 480t8.992-23.008T352 448z" p-id="4889" fill="#ffffff"></path></svg>',
  zoomIn: '<svg t="1628761724109" viewBox="0 0 1024 1024" width="24" height="24"><path d="M796 751.008l124.992 124.992q8.992 10.016 8.992 22.496t-9.504 22.016-22.016 9.504-22.496-8.992l-124.992-124.992q-132.992 108.992-295.008 99.488t-280.992-132.512q-114.016-128.992-111.008-291.008t122.016-286.016q124-119.008 286.016-122.016t291.008 111.008q123.008 119.008 132.512 280.992t-99.488 295.008zM480 832q150.016-4 248.992-103.008T832 480q-4-150.016-103.008-248.992T480 128q-150.016 4-248.992 103.008T128 480q4 150.016 103.008 248.992T480 832z m-32-384v-96q0-14.016 8.992-23.008T480 320t23.008 8.992T512 352v96h96q14.016 0 23.008 8.992T640 480t-8.992 23.008T608 512h-96v96q0 14.016-8.992 23.008T480 640t-23.008-8.992T448 608v-96h-96q-14.016 0-23.008-8.992T320 480t8.992-23.008T352 448h96z" p-id="4358" fill="#ffffff"></path></svg>',
  original: '<svg t="1628762365130" viewBox="0 0 1024 1024" width="24" height="24"><path d="M812.992 180.992q26.016 0 43.008 16.992t16.992 43.008v482.016q0 24.992-17.504 42.496t-42.496 17.504H210.976q-24.992 0-42.496-17.504t-17.504-42.496V240.992q0-26.016 16.992-43.008t43.008-16.992h602.016z m0-60.992H210.976q-24 0.992-46.016 10.016t-39.008 26.016-26.496 39.008-9.504 46.016v482.016q0 24 9.504 46.016t26.496 39.008 39.008 26.016 46.016 8.992h602.016q24 0 46.016-8.992t39.008-26.016 26.496-39.008 9.504-46.016V241.056q0-24-9.504-46.016t-26.496-39.008-39.008-26.016-46.016-10.016z m-120 180.992q-12.992 0-21.504 8.992t-8.512 20.992v300.992q0 12.992 8.512 21.504t21.504 8.512 21.504-8.512 8.512-21.504v-300.992q0-12.992-8.512-21.504t-21.504-8.512z m-361.984 0q-12 0-20.992 8.992t-8.992 20.992v300.992q0 12.992 8.512 21.504t21.504 8.512 21.504-8.512 8.512-21.504v-300.992q0-12-8.512-20.992t-21.504-8.992zM512 360.992q-12.992 0.992-21.504 9.504t-8.512 21.504v30.016q0 12 8.512 20.512t21.504 8.512 21.504-8.512 8.512-20.512v-30.016q0-12.992-8.992-21.504t-20.992-9.504zM512 512q-12.992 0-21.504 8.512t-8.512 21.504v30.016q0 12.992 8.512 21.504t21.504 8.512 21.504-8.512 8.512-21.504v-30.016q0-12-8.992-20.992t-20.992-8.992z" p-id="5954" fill="#ffffff"></path></svg>', 
  fullScreen: '<svg t="1628762716543" viewBox="0 0 1024 1024" width="24" height="24"><path d="M160 96h192q14.016 0.992 23.008 10.016t8.992 22.496-8.992 22.496T352 160H160v192q0 14.016-8.992 23.008T128 384t-23.008-8.992T96 352V96h64z m0 832H96v-256q0-14.016 8.992-23.008T128 640t23.008 8.992T160 672v192h192q14.016 0 23.008 8.992t8.992 22.496-8.992 22.496T352 928H160zM864 96h64v256q0 14.016-8.992 23.008T896 384t-23.008-8.992T864 352V160h-192q-14.016 0-23.008-8.992T640 128.512t8.992-22.496T672 96h192z m0 832h-192q-14.016-0.992-23.008-10.016T640 895.488t8.992-22.496T672 864h192v-192q0-14.016 8.992-23.008T896 640t23.008 8.992T928 672v256h-64z" p-id="6683" fill="#ffffff"></path></svg>',
  refreshLeft: '<svg t="1628762407981" viewBox="0 0 1024 1024" width="24" height="24"><path d="M288.992 296.992h92.992q14.016 0 23.008 8.992t8.992 22.496-8.992 22.496-23.008 10.016H232.992q-14.016-0.992-23.008-10.016t-8.992-22.016V179.968q0-14.016 8.992-23.008t23.008-8.992 23.008 8.992 8.992 23.008v50.016q86.016-76.992 196.512-95.488t217.504 26.496q106.016 48 167.488 142.016t62.496 210.016q-4 163.008-112.512 271.488t-271.488 112.512q-163.008-4-271.488-112.512t-112.512-271.488h64q3.008 136 93.504 226.496t226.496 93.504q136-3.008 226.016-93.504t94.016-226.496q-0.992-100.992-56-180.512t-148-117.504q-94.016-35.008-188.512-13.504T289.024 296.992z" p-id="6197" fill="#ffffff"></path></svg>',
  refreshRight: '<svg t="1628762417349" viewBox="0 0 1024 1024" width="24" height="24"><path d="M784.992 230.016V180q0-14.016 8.992-23.008t22.496-8.992 22.496 8.992 10.016 23.008v148.992q-0.992 12.992-10.016 22.016t-22.016 10.016h-148.992q-14.016-0.992-23.008-10.016t-8.992-22.496 8.992-22.496 23.008-8.992h92.992q-78.016-82.016-183.488-99.488t-204.512 34.496q-98.016 54.016-140.992 152t-16.992 208q28.992 108 113.504 173.504t196.512 67.488q136-3.008 226.016-93.504t94.016-226.496h64q-4 163.008-112.512 271.488t-271.488 112.512q-163.008-4-271.488-112.512t-112.512-271.488q0.992-116 62.016-210.016t167.008-140.992q107.008-46.016 217.504-27.488t197.504 95.488z" p-id="6440" fill="#ffffff"></path></svg>',
};

